<template>
  <div class="jiaose2">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="">
      <el-table
        :data="tableData"
        border
        stripe
      >
        <el-table-column
          type="index"
        ></el-table-column>
        <el-table-column
          label="权限名称"
          prop="authName"
        ></el-table-column>
        <el-table-column
          label="路径"
          prop="path"
        ></el-table-column>
        <el-table-column
          label="权限等级"
          prop="level"
        >
          <template #default="{ row }">
            <el-tag v-if="row.level === '0'">一级</el-tag>
            <el-tag v-else-if="row.level=== 1" type="info">二级</el-tag>
            <el-tag v-else type="warning"> 三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getRightList } from '@/api/roles'

export default {
  name: 'jiaoseTwo',
  data () {
    return {
      tableData: []
    }
  },
  created () {
    this.getList()
  },
  methods: {
    async getList () {
      const res = await getRightList()
      this.tableData = res.data
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
